package routes

import (
	"github.com/martini-contrib/render"
	"net/http"
)

type TmplValue struct {
	Title     string
	ExtValue  interface{}
	ExtValue2 interface{}
	ExtValue3 interface{}
}

func Index(r render.Render) {
	r.HTML(200, "jindex", TmplValue{Title: "FP Web Server"})
}

func ConfirmDlg(r render.Render, req *http.Request) {
	title := req.URL.Query().Get("title")
	hint := req.URL.Query().Get("hint")
	msg := req.URL.Query().Get("msg")

	var dlgInfo = struct {
		Title string
		Hint  string
		Msg   string
	}{Title: title, Hint: hint, Msg: msg}

	r.HTML(200, "confirmDlg", dlgInfo, render.HTMLOptions{Layout: ""})
}
